export interface UserProps {
  isLogin: boolean;
  userName?: string;
}

export interface TemplateProps {
  id: number;
  title: string;
  coverImg: string;
  author: string;
  copiedCount: number;
}


export interface ComponentData {
  id: string // 组件唯一标识 uuid v4 生成
  name: string
  props: Partial<TextComponentProps | ImageComponentProps>
}

export interface EditorProps {
  components: ComponentData[] // 画布组件数量
  currentElementId: string // 当前选中组件，uuid
}

export interface GlobalDataProps {
  user: UserProps;
  templates: TemplateProps[];
  editor: EditorProps;
}

export interface CommonDefaultProps {
  // actions
  actionType: string
  url: string
  // size
  width: string
  height: string
  paddingLeft: string
  paddingRight: string
  paddingTop: string
  paddingBottom: string
  // border
  borderWidth: string
  borderStyle: string
  borderColor: string
  borderRadius: string
  // shadow and opacity
  boxShadow: string
  opacity: string
  // position
  position: string
  top: string
  left: string
  right: string
}

export interface TextComponentProps extends CommonDefaultProps {
  text: string
  fontSize: number
  fontFamily: string
  fontWeight: string
  fontStyle: string
  textDecoration: string
  lineHeight: number
  textAlign: string
  color: string
  backgroundColor: string
}

export interface ImageComponentProps extends CommonDefaultProps {
  src: string
}